package com.woniu.springbootvideo.service.impl;

import com.woniu.springbootvideo.dao.VideoDao;
import com.woniu.springbootvideo.pojo.Video;
import com.woniu.springbootvideo.service.IVideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class VideoServiceImpl implements IVideoService {
    @Autowired
    private VideoDao videoDao;
    @Override
    public List<Video> findTenByType(Integer videoype) {
        return videoDao.findTenByType(videoype);
    }

    @Override
    public boolean save(Video video) {
        boolean flag = false;
        try {
            videoDao.save(video);
            flag=true;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return flag;
    }

    @Override
    public List<Video> findAllByType(Video video) {
        return videoDao.findAllByType(video);
    }
}
